<!--
 * @Description:
 * @Author: mxy
 * @Date: 2022-12-10 10:34:11
 * @LastEditors: mxy
 * @LastEditTime: 2022-12-10 14:56:57
-->
<template>
  <div>
    <h3>test组件</h3>
    <p>{{ age2 }}</p>
    <p>{{ aaa }}</p>
    <button @click="updateAgeAfter1s(5)">一秒后更新</button>
  </div>
</template>

<script>
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
export default {
  computed: {
    ...mapState({ age2: 'age' }),
    ...mapGetters(['aaa'])
  },
  methods: {
    ...mapMutations(['updateAge']),
    ...mapActions(['updateAgeAfter1s'])
  }
}
</script>

<style scoped>
div {
  background-color: skyblue;
}
</style>
